﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using HWmanagementDB;

namespace HWmanagementServer
{
    [DataContract]
    public class CourseModel
    {
        [DataMember]
        public int id;
        [DataMember]
        public string subjectid;
        [DataMember]
        public string semester;

        public static COURSE toDBTable(CourseModel cm)
        {
            return new COURSE() { ID = cm.id, SUBJECTID = cm.subjectid, SEMESTER=cm.semester };
        }

        public static CourseModel fromDBTable(COURSE c)
        {
            return new CourseModel() { id = c.ID, subjectid = c.SUBJECTID, semester=c.SEMESTER };
        }
    }
}
